package vn.aptech.scrumgroup.resource;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import android.content.Context;

public class ResourceReader {
	
	public static String readDataFromFile(Context context, int resourceID) throws IOException
	{
		InputStream inputStream = context.getResources().openRawResource(resourceID);
		BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
		StringBuilder builder = new StringBuilder();
		String line = null;
		while((line = reader.readLine()) != null)
		{
			builder.append(line);
			builder.append("\n");
		}
		reader.close();
		return builder.toString();
	}
}
